package com.winning.pmph.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.winning.pmph.entity.*;
import com.winning.pmph.enumeration.KnowledgeSystem;
import com.winning.pmph.mapper.*;
import com.winning.pmph.utils.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.io.File;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

/**
 * @author 吴笛
 */
@Component
@Transactional
public class TaskService extends ServiceImpl<TaskMapper, Task> {
    /**
     * 数据库更新成功
     */
    public static String UPDATE_SUCCESS = "success";

    /**
     * 数据库更新失败
     */
    public static String UPDATE_FAILED = "failed";

    @Resource
    private CalculatorService calculatorService;
    @Resource
    private KnowledgeLibService knowledgeLibService;
    @Resource
    private TempKnowledgeService tempKnowledgeService;
    @Resource
    private TempKnowledgeFieldService tempKnowledgeFieldService;
    @Resource
    private KnowledgeHistoryService KnowledgeHistoryService;
    @Resource
    private HistoryMapper historyMapper;
    @Resource
    private LastEditedFieldMapper lastEditedFieldMapper;
    @Resource
    private TaskMapper taskMapper;
    @Resource
    private TaskItemService taskItemService;
    @Resource
    private TaskFileService taskFileService;
    @Resource
    private FlowChartService flowChartService;
    @Resource
    private PlatformKnowledgeLibMapper platformKnowledgeLibMapper;
    @Resource
    MedicalCalculatorMapper medicalCalculatorMapper;
    @Resource
    MedicalCalculatorFieldService medicalCalculatorFieldService;
    @Resource
    private RocketMQProducerService rocketMQProducerService;
    @Resource
    private ActivityItemMapper activityItemMapper;
    @Resource
    private KnowledgeUnitService knowledgeUnitService;

    public List<TaskItem> queryTaskItem(int currentPage, int pageNum, String id, String status, String name, String systemType, String userEnName, String taskType, String drugInfoLibCompany) {
        String sql = getTaskItemQuerySql(id, status, name, systemType, userEnName, taskType, drugInfoLibCompany);
        sql += " order by updated_time desc,id limit " + currentPage * pageNum + " , " + pageNum;
        List<TaskItem> items = taskItemService.getBaseMapper().executeMultiSelect(sql);
        if (items.size() > 0) {
            DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            long start = 0;
            long end = 0;
            try {
                start = format.parse(items.get(0).getStartDate()).getTime();
                end = format.parse(items.get(0).getEndDate()).getTime();
            } catch (ParseException e) {
                e.printStackTrace();
                throw new RuntimeException(e.getMessage());
            }
            long subDateMilliSeconds = end - start;
            int totalSeconds = (int) (subDateMilliSeconds / 1000);
            int num = totalSeconds / (3600 * 24);

            KnowledgeLib knowledgeLibs = null;
            if (!"calculator_lib_id".equals(items.get(0).getKnowledgeLibId()) || !"flow_chart_lib_id".equals(items.get(0).getKnowledgeLibId()) || StringUtils.isNotBlank(items.get(0).getKnowledgeLibId())) {
                knowledgeLibs = knowledgeLibService.getById(items.get(0).getKnowledgeLibId());
            }
            for (TaskItem item : items) {
                if ("knowledge".equals(item.getSystemType())) {
                    if (knowledgeLibs != null) {
                        item.setKnowledgeLibName(knowledgeLibs.getName());
                    } else {
                        item.setKnowledgeLibName("");
                    }
                }
                item.setNum(num);
            }
        }
        return items;
    }

    @NotNull
    private String getTaskItemQuerySql(String id, String status, String name, String systemType, String userEnName, String taskType, String drugInfoLibCompany) {
        String sql = "select t.start_date,t.end_date,t.enable_create,t.system_type,t.audit_level,t.knowledge_lib_id,ti.* from task t LEFT join task_item ti on ti.task_id = t.id where ti.task_id ='" + id + "' and ti.status!=" + TaskItem.STATUS_RELEASED + " and ti.deleted=" + TaskItem.NO_DELETED + " and ti.status != " + TaskItem.STATUS_FINAL_REJECT;
        if (StringUtils.isNotBlank(status)) {
            if ("underReview".equals(status)) {
                sql += " and (ti.status=" + TaskItem.STATUS_COMMIT + " or ti.status=" + TaskItem.STATUS_PASS_1 + " or ti.status=" + TaskItem.STATUS_PASS_2 + " or ti.status=" + TaskItem.STATUS_REJECT_2 + " or ti.status=" + TaskItem.STATUS_REJECT_3 + ")";
            } else if ("3".equals(status)) {
                sql += " and (ti.status=" + TaskItem.STATUS_REJECT + ")";
            } else {
                sql += " and ti.status = '" + status + "'";
            }
        }
        if (StringUtils.isNotBlank(name)) {
            sql += " and ti.name like '%" + name + "%'";
        }
        if (StringUtils.isNotBlank(systemType)) {
            sql += " and t.system_type = '" + systemType + "'";
        }
        if (StringUtils.isNotBlank(userEnName)) {
            sql += " and ti.editor = '" + userEnName + "'";
        }
        if (StringUtils.isNotBlank(taskType)) {
            sql += " and ti.type = '" + taskType + "'";
        }
        if (StringUtils.isNotBlank(drugInfoLibCompany)) {
            sql += " and ti.knowledge_id in (select knowledge_id from temp_knowledge_field where knowledge_lib_field_id = '" + Const.DRUG_INFO_LIB_COMPANY_ID + "' and property like '%" + drugInfoLibCompany + "%')";
        }
        return sql;
    }


    public int queryTaskItemNum(String id, String status, String name, String systemType, String userEnName, String taskType, String drugInfoLibCompany) {
        String sql = "select t.start_date,t.end_date,t.enable_create,t.system_type,t.audit_level,t.knowledge_lib_id,ti.* from task t LEFT join task_item ti on ti.task_id = t.id where ti.task_id ='" + id + "' and ti.status!='" + TaskItem.STATUS_RELEASED + "'";
        if (StringUtils.isNotBlank(status)) {
            if ("underReview".equals(status)) {
                sql += " and (ti.status=" + TaskItem.STATUS_COMMIT + " or ti.status=" + TaskItem.STATUS_PASS_1 + " or ti.status=" + TaskItem.STATUS_PASS_2 + TaskItem.STATUS_REJECT_2 + " or ti.status=" + TaskItem.STATUS_REJECT_3 + ")";
            } else if ("3".equals(status)) {
                sql += " and (ti.status=" + TaskItem.STATUS_REJECT + ")";
            } else {
                sql += " and ti.status = '" + status + "'";
            }
        }
        if (StringUtils.isNotBlank(name)) {
            sql += " and ti.name like '%" + name + "%'";
        }
        if (StringUtils.isNotBlank(systemType)) {
            sql += " and t.system_type = '" + systemType + "'";
        }
        if (StringUtils.isNotBlank(userEnName)) {
            sql += " and ti.editor = '" + userEnName + "'";
        }
        if (StringUtils.isNotBlank(taskType)) {
            sql += " and ti.type = '" + taskType + "'";
        }
        if (StringUtils.isNotBlank(drugInfoLibCompany)) {
            sql += " and ti.knowledge_id in (select knowledge_id from temp_knowledge_field where knowledge_lib_field_id = '" + Const.DRUG_INFO_LIB_COMPANY_ID + "' and property like '%" + drugInfoLibCompany + "%')";
        }
        List<TaskItem> items = taskItemService.getBaseMapper().executeMultiSelect(sql);
        return items.size();
    }


    public String delete(String id) throws Exception {
        String sql = "delete from task where id = '" + id + "'";
        int affectedNum = taskMapper.executeDelete(sql);
        if (affectedNum <= 0) {
            throw new Exception("删除任务失败，任务ID：" + id);
        }

        sql = "delete from task_item where task_id = '" + id + "'";
        taskItemService.getBaseMapper().executeDelete(sql);
        return UPDATE_SUCCESS;
    }


    public String start(String id) {
        String sql = "update task set status =" + Task.STATUS_STARTED + ",updated_time='" + LocalDateTimeUtil.getNowAsString() + "'  where id = '" + id + "'";

        int affectedNum = taskMapper.executeUpdate(sql);
        if (affectedNum > 0) {
            return UPDATE_SUCCESS;
        } else {
            return UPDATE_FAILED;
        }
    }


    public void finish(String id) {
        List<TaskItem> unPublishedTaskItemList = taskItemService.lambdaQuery()
                .eq(TaskItem::getTaskId, id)
                .ne(TaskItem::getStatus, TaskItem.STATUS_RELEASED)
                .list();
        if (CollectionUtils.isNotEmpty(unPublishedTaskItemList)) {
            throw new RuntimeException("存在未发布的子任务, 无法结束任务");
        }
        Task task = getById(id);
        task.setStatus(Task.STATUS_FINISHED);
        updateById(task);
    }


    public List<TaskItem> selectSimilarTaskItem(@NotNull String taskItemName, @NotNull String knowledgeLibId) {
        // 查询taskItem表相关数据
        String sql = "select task_item.* from task " +
                " left join task_item on task_item.task_id = task.id" +
                " where knowledge_lib_id = '" + knowledgeLibId + "' and task_item.name like '%" + taskItemName + "%'";
        List<TaskItem> taskItems = taskItemService.getBaseMapper().executeMultiSelect(sql);
        // 结果集中知识id为空, 说明未开始, 全部返回;
        List<TaskItem> result = taskItems.stream()
                .filter(item -> StringUtils.isEmpty(item.getKnowledgeId()))
                .collect(Collectors.toList());
        // 已经与(知识, 计算器, 流程图)关联的taskItem, 去重
        Map<String, Optional<TaskItem>> kid2TaskItemMap = taskItems.stream()
                .filter(item -> StringUtils.isNotEmpty(item.getKnowledgeId()))
                .collect(
                        Collectors.groupingBy(
                                TaskItem::getKnowledgeId,
                                Collectors.maxBy(Comparator.comparing(TaskItem::getId))));
        kid2TaskItemMap.values().stream().map(Optional::get).forEach(result::add);
        return result;
    }


    public void batchSubmit(String taskId, String name) {
        List<TaskItem> taskItemList = taskItemService.lambdaQuery()
                .eq(TaskItem::getTaskId, taskId)
                .eq(TaskItem::getEditor, PMPHAppUtil.getCurrentUserEnName())
                .eq(TaskItem::getStatus, TaskItem.STATUS_NOT_COMMIT)
                .eq(TaskItem::getDeleted, TaskItem.NO_DELETED)
                .like(TaskItem::getName, name)
                .gt(TaskItem::getWordsCount, 0)
                .list();
        // 需要查询任务审核级别, 便于计算当前操作人;
        Task task = getById(taskId);
        for (TaskItem taskItem : taskItemList) {
            taskItem.setStatus(TaskItem.STATUS_COMMIT);
            taskItem.setUpdatedBy(PMPHAppUtil.getCurrentUserEnName());
            taskItem.setUpdatedTime(LocalDateTimeUtil.getNowAsString());
            taskItem.setSubmitTime(taskItem.getUpdatedTime());
            taskItem.setAuditLevel(task.getAuditLevel());
            // 当前操作人  自动计算;
        }
        taskItemService.updateBatchById(taskItemList);
    }


    public Task saveTask(String taskJsonString) throws Exception {
        JSONObject taskJson = JSONObject.parseObject(taskJsonString);
        JSONObject basicInfoJson = taskJson.getJSONObject("basicInfo");
        JSONArray subTaskJson = taskJson.getJSONArray("subTask");

        Task task = buildTaskObject(basicInfoJson);
        task = taskMapper.saveBean(task);
        List<TaskItem> taskItemList = buildTaskItemList(subTaskJson, task);
        saveTaskItemList(taskItemList);

        JSONArray fileListJsonArray = basicInfoJson.getJSONArray("fileList");
        List<TaskFile> taskFileList = new ArrayList<>();
        for (Object obj : fileListJsonArray) {
            JSONObject fileJsonObj = (JSONObject) obj;
            String from = ApplicationContextUtil.BASE_DOWN_FORDER + fileJsonObj.getString("path");
            String name = fileJsonObj.getString("name");
            String to = "file/task/" + task.getId() + "/" + name;
            String size = fileJsonObj.getString("size");
            UploadFileUtil.transferFile(from, ApplicationContextUtil.BASE_DOWN_FORDER + to, true);
            TaskFile taskFile = buildTaskFile(task, name, to, size);
            taskFileList.add(taskFile);
        }
        taskFileService.saveOrUpdateBatch(taskFileList);

        return task;
    }


    public void saveTaskItem(TaskItem taskItem, String username) {
        // 判断已关联知识是否已存在正在进行中的任务;
        if (StringUtils.isEmpty(taskItem.getId()) && taskItem.getType() == TaskItem.TYPE_EDIT) {
            // 如果有修订任务, 则给子任务表加锁 select for update;
            List<TaskItem> taskItems = taskItemService.getBaseMapper().executeMultiSelect("select * from task_item where knowledge_id = '" + taskItem.getKnowledgeId() + "' and status != " + TaskItem.STATUS_RELEASED + " for update");
            if (CollectionUtils.isNotEmpty(taskItems)) {
                throw new RuntimeException(taskItem.getName() + "已经有正在修订中的子任务, 不能再次修订");
            }
        }
        // 如果是修订, 则校验temp是否有数据, 否则从release表拷贝一份到temp;
        Task task = taskMapper.selectById(taskItem.getTaskId());
        if (taskItem.getType() == TaskItem.TYPE_EDIT) {
            // 计算器;
            if (Objects.equals(task.getKnowledgeLibId(), KnowledgeLib.CALCULATOR_LIB_ID)) {
                MedicalCalculator tempCalculator = calculatorService.getMedicalCalculator(taskItem.getKnowledgeId());
                if (Objects.isNull(tempCalculator)) {
                    calculatorService.releasedCalculator2TempCalculator(taskItem.getKnowledgeId(), username);
                }
            }
            // 流程图
            else if (Objects.equals(task.getKnowledgeLibId(), KnowledgeLib.FLOW_CHART_LIB_ID)) {
                FlowChart tempFlowChart = flowChartService.getById(taskItem.getKnowledgeId());
                if (Objects.isNull(tempFlowChart)) {
                    flowChartService.ReleasedFlowChart2FlowChart(taskItem.getKnowledgeId());
                }
            }
            // 知识库
            else {
                TempKnowledge tempKnowledge = tempKnowledgeService.getById(taskItem.getKnowledgeId());
                if (Objects.isNull(tempKnowledge)) {
                    KnowledgeEditUtil.releaseKnowledge2TempKnowledge(taskItem.getKnowledgeId());
                }
            }
        }
        // 判断taskItem是否修改, 如果修改, 则需要同时修改知识, 计算器, 流程图;
        if (StringUtils.isNotEmpty(taskItem.getId())) {
            TaskItem dbTaskItem = taskItemService.getById(taskItem.getId());
            if (!Objects.equals(dbTaskItem.getName(), taskItem.getName()) && StringUtils.isNotEmpty(taskItem.getKnowledgeId())) {
                // 计算器;
                if (Objects.equals(task.getKnowledgeLibId(), KnowledgeLib.CALCULATOR_LIB_ID)) {
                    MedicalCalculator medicalCalculator = medicalCalculatorMapper.selectById(taskItem.getKnowledgeId());
                    medicalCalculator.setFormulaName(taskItem.getName());
                    medicalCalculatorMapper.updateById(medicalCalculator);
                    medicalCalculatorFieldService.lambdaUpdate()
                            .eq(MedicalCalculatorField::getMedicalCalcId, taskItem.getId())
                            .eq(MedicalCalculatorField::getKind, MedicalCalculatorField.INPUT_BOX)
                            .set(MedicalCalculatorField::getProperty, taskItem.getName());

                }
                // 流程图
                else if (Objects.equals(task.getKnowledgeLibId(), KnowledgeLib.FLOW_CHART_LIB_ID)) {
                    flowChartService.getBaseMapper().executeUpdate("update flow_chart set flow_name = '" + taskItem.getName() + "', updated_by = '" + username + "', updated_time ='" + LocalDateTimeUtil.getNowAsString() + "' where id = '" + taskItem.getKnowledgeId() + "'");
                }
                // 知识库
                else {
                    tempKnowledgeService.getBaseMapper().executeUpdate("update temp_knowledge set name = '" + taskItem.getName() + "', updated_by = '" + username + "', updated_time = '" + LocalDateTimeUtil.getNowAsString() + "' where id = '" + taskItem.getKnowledgeId() + "'");
                    tempKnowledgeFieldService.getBaseMapper().executeUpdate("update temp_knowledge_field set property = '" + taskItem.getName() + "', updated_by = '" + username + "', updated_time = '" + LocalDateTimeUtil.getNowAsString() + "' where knowledge_id = '" + taskItem.getKnowledgeId() + "' and `index` = 0");

                }
            }
        }
        taskItemService.saveOrUpdate(taskItem);
    }

    public void taskItemAdd(TaskItem taskItem, String username, ActivityItem activityItem) {
        if (StringUtils.isEmpty(taskItem.getId())) {
            taskItemService.saveOrUpdate(taskItem);
            activityItem.setStatus(ActivityItem.DISTRIBUTION);
            activityItem.setTaskId(taskItem.getTaskId());
            activityItemMapper.updateById(activityItem);
        }
    }


    public boolean deleteTaskFile(TaskFile taskFile) {
        taskFileService.removeById(taskFile.getId());
        return new File(ApplicationContextUtil.BASE_DOWN_FORDER + taskFile.getPath()).delete();
    }


    public String cancelAudit(String taskItemId, String knowledgeId, String reason) {
        TaskItem taskItem = taskItemService.getById(taskItemId);
        String taskId = taskItem.getTaskId();
        Task task = getById(taskId);
        if (task.getStatus() == Task.STATUS_FINISHED) {
            return "任务已经完成，不可以修改子任务的状态";
        }
        taskItem.setStatus(TaskItem.STATUS_FINAL_REJECT);
        taskItem.setReject(reason);
        // 设置审核级别, 用于计算crtOperator;
        taskItem.setAuditLevel(task.getAuditLevel());
        taskItemService.saveOrUpdate(taskItem);
        TaskItem item = taskItemService.getById(taskItemId);
        HistoryUtils.save(knowledgeId, item.getName(), History.OPERATE_REJECT, History.OPERATE_RESULT_SUCCESS);
        return UPDATE_SUCCESS;
    }


    public void deleteTaskItem(TaskItem taskItem) {
        String knowledgeId = taskItem.getKnowledgeId();
        // 删除对应的子任务
        taskItemService.removeById(taskItem.getId());
        if (StringUtils.isNotBlank(taskItem.getKnowledgeId())) {
            // 删除子任务对应的知识(已发布的知识在子任务列表不能删除)
            // 判断是知识,流程图,医学计算器
            if (KnowledgeSystem.KNOWLEDGE.value.equals(taskItem.getSystemType())) {
                // 清理素材库;
                knowledgeUnitService.deleteTaskItem(taskItem);
                updateBindingKnowledge(knowledgeId);
                tempKnowledgeService.removeById(taskItem.getKnowledgeId());
                // 删除子任务对应的知识字段表
                tempKnowledgeFieldService.remove(Wrappers.lambdaQuery(TempKnowledgeField.class).eq(TempKnowledgeField::getKnowledgeId, taskItem.getKnowledgeId()));
                //删除投稿详情
                activityItemMapper.delete(Wrappers.lambdaQuery(ActivityItem.class).eq(ActivityItem::getKnowledgeId, knowledgeId));
            } else if (KnowledgeSystem.CALCULATOR.value.equals(taskItem.getSystemType())) {
                calculatorService.deleteById(taskItem.getKnowledgeId());
            } else {
                flowChartService.deleteById(taskItem.getKnowledgeId());
            }
            // 修订类型,只删除当前修订的知识,已发布的知识版本保留,因记录表是以知识ID作为标记,所以无法删除所有历史记录,
            // 所以记录删除操作,如果是自建或者非自建,删除知识和历史记录
            if (taskItem.getType() == TaskItem.TYPE_EDIT) {
                HistoryUtils.save(taskItem.getKnowledgeId(), taskItem.getName(), History.OPERATE_UNPUB_DELETE, History.OPERATE_RESULT_SUCCESS);
            } else {
                // 删除历史表
                historyMapper.deleteBeansByWherePart(" knowledge_id = '" + taskItem.getKnowledgeId() + "'");
                // 删除字段新旧值对应表
                lastEditedFieldMapper.deleteBeansByWherePart(" knowledge_id = '" + taskItem.getKnowledgeId() + "'");
            }
        }
    }

    /**
     * 更新关联知识
     *
     * @param knowledgeId 知识id
     */
    private void updateBindingKnowledge(String knowledgeId) {
        TempKnowledge knowledge = tempKnowledgeService.getById(knowledgeId);
        Map<String, Object> knowledgeMap = knowledgeLibService.updateBindingKnowledge(knowledge);
        List<ReleasedKnowledge> rList = (List<ReleasedKnowledge>) knowledgeMap.get("releasedKnowledgeList");
        rList.forEach(rKnowledge -> {
            FieldCompareUtil.recordChangesInKnowledgeFields(History.OPERATE_CORRECT, rKnowledge);
            KnowledgeHistoryService.add(rKnowledge);
            HistoryUtils.save(rKnowledge.getId(), rKnowledge.getName(), History.OPERATE_CORRECT, History.OPERATE_RESULT_SUCCESS);
            rKnowledge.setSyncOperation(ReleasedKnowledge.SYNC_OPERATION_MODIFY);
            List<PlatformKnowledgeLib> platformKnowledgeLibs = platformKnowledgeLibMapper.selectBeansByWherePart("knowledge_lib_id = '" + knowledge.getKnowledgeLibId() + "'");
            for (PlatformKnowledgeLib platformKnowledgeLib : platformKnowledgeLibs) {
                rocketMQProducerService.sendKnowledge(platformKnowledgeLib.getPlatformId(), rKnowledge, PMPHAppUtil.getCurrentUserEnName());
            }
        });
    }

    private Task buildTaskObject(JSONObject basicInfoJson) {
        Task task = new Task();

        String name = basicInfoJson.getString("name");
        task.setName(name);
        int enableCreate = basicInfoJson.getBoolean("selfAdd") ? 1 : 0;
        task.setEnableCreate(enableCreate);
        String systemType = basicInfoJson.getString("system");
        task.setSystemType(systemType);
        int auditLevel = basicInfoJson.getInteger("reviewLevel");
        task.setAuditLevel(auditLevel);
        String knowledgeLibId = basicInfoJson.getString("lib");
        task.setKnowledgeLibId(knowledgeLibId);
        task.setStatus(Task.STATUS_NOT_STARTED);
        task.setDeleted(Task.NOT_DELETED);
        JSONArray dateRangeJsonArray = basicInfoJson.getJSONArray("dateRange");
        if (dateRangeJsonArray.size() > 1) {
            String startDate = (String) dateRangeJsonArray.get(0);
            String endDate = (String) dateRangeJsonArray.get(1);
            task.setStartDate(startDate);
            task.setEndDate(endDate);
        }
        String remark = basicInfoJson.getString("comment");
        task.setRemark(remark);

        return task;
    }

    @NotNull
    private TaskFile buildTaskFile(Task task, String name, String to, String size) {
        TaskFile taskFile = new TaskFile();
        taskFile.setTaskId(task.getId());
        taskFile.setName(name);
        taskFile.setPath(to);
        taskFile.setSize(size);
        return taskFile;
    }

    private List<TaskItem> buildTaskItemList(JSONArray subTaskJson, Task task) {
        List<TaskItem> taskItemList = new ArrayList<>();
        for (Object obj : subTaskJson) {
            JSONObject subTaskJsonObj = (JSONObject) obj;
            TaskItem taskItem = JSON.parseObject(subTaskJsonObj.toJSONString(), TaskItem.class);
            String taskId = task.getId();
            taskItem.setTaskId(taskId);
            taskItemList.add(taskItem);
        }
        return taskItemList;
    }

    private void saveTaskItemList(List<TaskItem> taskItemList) {
        for (TaskItem taskItem : taskItemList) {
            saveTaskItem(taskItem, PMPHAppUtil.getCurrentUserEnName());
        }
    }
}
